var dragelem = null;
var ox =0;
var oy =0;
function clearpx (stro){
		str=""+stro+"";
		return (str.replace("px",""))*1;
}

function D_start(mydiv){
	document.getElementById('myframeW').style.visibility='hidden';
	eventh.handle(document,"mousemove",D_moving);
	eventh.handle(document,"mouseup",D_end);
	mydiv.style.cursor="move";
	document.onmousemove=function (){return false;}
	mydiv.ondragstart=function (){return false;}
	dragelem=mydiv;
}

function D_moving(mevent){
	if(dragelem){
		dragelem.style.top = mevent.clientY-10;
		dragelem.style.left = mevent.clientX-clearpx(dragelem.style.width)/2;
	}else{
		eventh.del(document,"mousemove",D_moving);
	}
}

function D_end(mevent){
	document.getElementById('myframeW').style.visibility="visible";
	if(dragelem){
		dragelem.style.cursor="default";
		eventh.del(document,"mousemove",D_moving);
		dragelem=null;
	}
}